import { Component, EventEmitter,Input,OnDestroy,OnInit,Output,TemplateRef,ViewChild } from '@angular/core';
import {ListComponent} from '../list/list.component';
@Component({
  selector: 'xm-item',
  templateUrl: './item.component.html',
  styleUrls: ['./item.component.css']
})
export class ItemComponent implements OnDestroy,OnInit {
  @Input() xmTitle;
  @Output() xmClick = new EventEmitter<void>();
  constructor(private listComponent: ListComponent) {
  }

  ngOnInit() {
    this.listComponent.addItem(this);
  }
  ngOnDestroy(){
    this.listComponent.removeItem(this);
  }
}
